package com.itheima.service.db.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.domain.vo.PageBeanVo;
import com.itheima.mapper.AnnouncementMapper;
import com.itheima.service.db.AnnouncementService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;


@Service
public class AnnouncementServiceImpl implements AnnouncementService {

    @Autowired
    private AnnouncementMapper announcementMapper;
    /*
     *
     * 查询所有公告通知
     * @author
     * @date
     * @return com.itheima.domain.db.Announcement
     */

    @Override
    public PageBeanVo findAll(Integer pageNum, Integer pageSize) {
        IPage page=new Page(pageNum,pageSize);


        page=announcementMapper.selectPage(page, null);


        return new PageBeanVo(pageNum ,pageSize ,page.getTotal(),page.getRecords());
    }
}
